{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <!-- 表单头部 -->
                <div class="card-header">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fas fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="card-body">
                        <!-- <div class="form-group row rowSelect">
    <label for="school_id" class="col-sm-2 col-form-label">配送地</label>
    <div class="col-sm-10 col-md-4 formInputDiv">
        <select name="school_id" id="school_id" class="form-control select2bs4 fieldSelect" data-placeholder="请选择配送地">
            <option value=""></option>
           
    <option value="0" >
        公司
    </option>
     <option value="1" >
        学校
    </option>
        </select>
    </div>

    <script>
        $('#school_id').select2({
            theme: 'bootstrap4'
        });
    </script>
</div> -->


<div class="form-group row rowDatetime">
    <label for="send_time" class="col-sm-2 col-form-label">配送时间</label>
    <div class="col-sm-10 col-md-4 formInputDiv">
        <input id="send_time" readonly name="send_time" value="{$data.send_time|default=''}" placeholder="请选择配送时间" type="text" class="form-control filedDatetime">
    </div>
    <script>
        laydate.render({
            elem: '#send_time',
            type: 'datetime',
        });
    </script>
</div>



                    </div>
                    <!-- 表单底部 -->
                    <div class="card-footer">
                        <div class="row">
                            <div class="col-sm-2">
                            </div>

                            <div class="col-sm-10 col-md-4 formInputDiv">

                                <div class="btn-group">
                                    <button type="submit" class="btn btn-sm btn-primary dataFormSubmit">
                                        保 存
                                    </button>
                                </div>
                                <div class="btn-group">
                                    <button type="reset" class="btn btn-sm btn-default dataFormReset">
                                        重 置
                                    </button>
                                </div>

                                {if !isset($data)}
                                <div class="btn-group float-right createContinueDiv">
                                    <input type="checkbox" class="form-check-input" value="1" id="_create" name="_create" title="继续添加数据">
                                    <label class="form-check-label" for="_create">继续添加</label>
                                </div>
                                {/if}
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>

<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
                'school_id': {
                required: true,

    },
    'user_id': {
                required: true,

    },
    'code': {
                required: true,

    },
    'send_time': {
                required: true,

    },
    'money': {
                required: true,

    },
    'status': {
                required: true,

    },
    'is_true': {
                required: true,

    },

        },
        messages: {
                'school_id': {
               required: "学校不能为空",

    },
    'user_id': {
               required: "供应商不能为空",

    },
    'code': {
               required: "采购单号不能为空",

    },
    'send_time': {
               required: "配送时间不能为空",

    },
    'money': {
               required: "收货金额不能为空",

    },
    'status': {
               required: "单据状态不能为空",

    },
    'is_true': {
               required: "是否确认不能为空",

    },

        }
    });
    
</script>
{/block}